<script setup lang="ts">
import { RoleType, roleTypeToString } from '../model'

const props = defineProps<{
    role?: RoleType
}>()
const roleType = (roleType?: RoleType | string) => {
    switch (roleType) {
        case RoleType.ADMIN:
            return 'danger'
        case RoleType.APPLICANT:
            return 'primary'
        case RoleType.APPROVER:
            return 'success'
    }
    return ''
}
</script>

<template>
    <el-tag :type="roleType(props.role)" round >{{ roleTypeToString(props.role) }}</el-tag>
</template>

<style scoped>

</style>